<script>
	import util from 'utils/util.js'
	import route from 'utils/draw-map.js';
	export default {
		onLaunch: function() {
			console.log('App Launch');
			const token = uni.getStorageSync('usertoken');
			if (token) {
				console.log(token);
			} else {
				this.toLogin();
				return;
			}
			
			var data = {
				'usertoken':token
			};
			util.post('horseman/appautologin',data,(res) => {
				if (res.status == 1){
					console.log('appautologin ok');
					uni.switchTab({
						url: '/pages/order/order'
					});
				}
			});
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			toLogin: function(res) {
				uni.showToast({
					title: '请先登录',
					duration: 2000,
					position: 'bottom'
				});
				uni.reLaunch({
					url: '/pages/login/login'
				}); 
			},
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	button::after{
		border: none;
	}
	.input-box {
		padding: 50upx;
		font-size: 30upx;
		.input-item {
			display: flex;
			background: white;
			border-bottom: 1upx solid #eeeeee;
			line-height: 100upx;
			height: 100upx;
			.input-label {
				width: 150upx;
			}
			.input-body{
				position: relative;
				height: 100upx;
				width: calc(100% - 150upx);
				.input {
					line-height: 100upx;
					height: 100upx;
					position: relative;
					font-size: 28upx;
				}
				.eye{
					position: absolute;
					height: 50upx;
					width: 50upx;
					right: 0;
					top: 50%;
					transform: translateY(-50%);
				}
				.btn-code{
				    position: absolute;
				    right: 0upx;
				    top:50%;
				    transform: translateY(-50%);
					background: none;
					color: #205592;
					width: 160upx;
					font-size: 24upx;
					box-sizing: border-box;
					text-align: right;
					padding: 0;
					height: 100upx;
					line-height: 100upx;
				}
			}
			
		}
		.select {
			padding-top: 40upx;
			display: flex;
			justify-content: space-between;
			color: #003B67;
		}
	}
	.button{
		margin:0 30upx;
		background: #FF6622;
		border-radius:50upx;
		line-height: 80upx;
		height: 80upx;
		color: white;
		font-size: 32upx;
	}
</style>
